import "./enlarge.scss"
import $ from "jquery";


$(function () {
    //鼠标点击切换指向
    $("#ul li").click(function () {
        $(this).addClass("border_c").siblings().removeClass("border_c");
        var index = $(this).index();
        console.log(index)
        $(".show ul li").css({
            display: function () {
                if (index == $(this).index()) {
                    return "block"
                } else {
                    return "none"
                }
            }
        })
    });
});
var timer = null;
//点击提 使列表向上走
$(".shang").mousedown(function(){
    clearInterval(timer);
   timer= setInterval(function(){
        console.log($("#ul").css("top"));
        
        $("#ul").css({
            top:function(index,value){
                let a = parseFloat(value)-1;
                if(a > -680){
                    return a
                }else{
                     clearInterval(timer);
                     return -680;
                }
            }
        })            
    },100);
});
//点击拉 使列表向下走
$(".xia").mousedown(function(){
    clearInterval(timer);
   timer= setInterval(function(){
        console.log($("#ul").css("top"));
        
        $("#ul").css({
            top:function(index,value){
                let a = parseFloat(value)+1;
                if(a < 0){
                    return a
                }else{
                     clearInterval(timer);
                     return 0;
                }
            }
        })            
    },100);
});
$(".shang,.xia").mouseup(function(){
    clearInterval(timer);
})

